---@class Battle.AiWaitAction:Battle.AiLeaf
---@field New fun():Battle.AiWaitAction
local AiWaitAction = Battle.CreateClass("AiWaitAction",Battle.AiLeaf)
Battle.AiWaitAction = AiWaitAction
local t = AiWaitAction
function t:Awake()
    self:SetParamKey(1,"minSecond")
    self:SetParamKey(2,"maxSecond")
end
function t:onInitialize()
    self.minSecond = self:GetParam("minSecond")
    self.maxSecond = self:GetParam("maxSecond")
    if self.maxSecond and self.maxSecond > self.minSecond then
        self.waitTime = math.random(self.minSecond,self.maxSecond)
    else
        self.waitTime = self.minSecond
    end

end
function t:update(dt)
    self.waitTime = self.waitTime - dt
    if self.waitTime <= 0 then
        return Battle.AiTreeStatus.SUCCESS
    end
    return Battle.AiTreeStatus.RUNNING
end